package utils.runnable;

import entity.VideoItem;
import utils.webdav.WebDavTool;

import java.io.File;

public class WebDavUploadRunnable implements Runnable {
    private final String filePath;
    private final File file;
    private final VideoItem item;

    @Override
    public void run() {
        String result = WebDavTool.getInstance().upload(filePath, file);
        if (result != null) {
            item.setIsWebDav(2);
        } else {
            item.setIsWebDav(0);
        }
    }

    public WebDavUploadRunnable(String filePath, File file, VideoItem item) {
        this.filePath = filePath;
        this.file = file;
        this.item = item;
    }
}
